import React from 'react'
import {useParams, useSearchParams, useLocation} from 'react-router-dom'

export default function Message() {
  // 读取params参数
  const params = useParams()
  // 读取search参数
  const [searchParams, setSearchParams] = useSearchParams()
  const title = searchParams.get('title')
  // 读取state参数
  const location = useLocation()
  console.log(location)
  const content = location.state.content
  return (
    <div>
      <h3>Message</h3>
      <p>params.id: {params.id}</p>
      <p>query.title: {title}</p>
      <p>state.content: {content}</p>
    </div>
  )
}
